package com.gandong8.trace.web.controller;

import com.gandong8.trace.web.domain.common.Result;
import com.gandong8.trace.domain.vo.TestVO;
import lombok.extern.slf4j.Slf4j;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Slf4j
@Controller
// @RequestMapping(value = "/", produces = "text/html;charset=UTF-8")
@RequestMapping(value = "/", produces = "application/json;charset=UTF-8")
public class IndexController{

    @RequestMapping(value = {"","/index"})
    @ResponseBody
    public Result index(){
        return Result.success();
    }

    @RequestMapping(value = "/a1")
    @ResponseBody
    public Result index1(String id, String name){
        return Result.success(id+";"+name);
    }

    @RequestMapping(value = "/a2/{data_id}")
    @ResponseBody
    public Result index2(@PathVariable("data_id") Long dataId){
        return Result.success();
    }

    @RequestMapping(value = "/a3")
    @ResponseBody
    public Result index3(@RequestParam(value="id") int userId){
        return Result.success();
    }

    @RequestMapping(value = "/a4")
    @ResponseBody
    public Result index4(TestVO testVO, String pwd){
        return Result.success();
    }

    @RequestMapping(value = "/a5", method = RequestMethod.POST)
    @ResponseBody
    public Result index5(@RequestBody TestVO testVO){
        return Result.success();
    }



}
